<? $this->view('admin/helper/filter/items_filter'); ?>

<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>

<form action="<?= base_url() ?><?= get_segment(1) ?>/<?= get_segment(2) ?>/all" method="post" style="margin-bottom: 5px;" />
<div class="row-fluid">
    <div class="span12">
        <div  class="box">
            <div class="tab-header"> <?=lang('label_browser')?> </div>

            <div id='data_contant'>

                <table class="table">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="checkall" name="all"></th>
                            <th><?=lang('label_image')?></th>
                            <th><?=lang('label_title')?></th>
                            <th><?=lang('label_order_number')?></th>
                            <th><?=lang('label_statues')?></th>
                            <th><?=lang('label_quantity')?></th>
                            <th><?=lang('label_weight')?></th>
                            <th><?=lang('label_add_by')?></th>
                            <th><?=lang('label_created_date')?></th>
                            <th><?=lang('label_last_update')?></th>
                            <th><?=lang('label_user_update')?></th>
                            <th><?=lang('label_tool')?></th>
                        </tr>
                    </thead>
                        <tbody>
                    <? foreach ($result as $value) { 
                       
                        ?>
                    
                            <tr class="gradeA">
                                <td><input type="checkbox" class="checkall" value="<?= $value->id ?>" name="id[]"></td>
                                <td>
                                    <? if($value->type == 'item_paid'){ ?>
                                    <img class="tip img-polaroid" data-placement="left" <? if(!empty($value->file)){ ?> data-original-title="<img src='<?=display_img(PRODUCT_PATH, $value->file,'default.png')?>' style='width: 200px;' \>" <? } ?>   style="margin: 3px;width: 100px;" src="<?=display_img(PRODUCT_PATH, $value->file,'default.png')?>">
                                <? } ?>
                                </td>
                                <td class="w300">
                                    <? if($value->type == 'item_box'){ ?>
                                    <i class="icon-truck" title="Box"></i>
                                    <? } ?>
                                    <a href="<?= base_url() . ADMIN_FOLDER ?>/<?= get_segment(2) ?>/view/<?= $value->id ?>">
                                        <?= $value->store ?> <?= substr($value->title, 0, 100) ?>

                                    </a>
                                    <p style="color:red;"><a style="color:red;" target="_blank" href="<?=get_shiping_company($value->shipingcom_out,'link')?><?= $value->track ?>"><?= $value->track ?></a></p>
                                </td>
                                <td><?= $value->order_id ?></td>
                                <td><?= $value->Status ?>
                                    <? if ($value->amrica_track != '') { ?>
                                        <p style="color:red;"><a style="color:red;" target="_blank" href="<?=get_shiping_company($value->shipingcom_in,'link')?><?= $value->amrica_track ?>"><?= $value->amrica_track ?></a></p>
                                    <? } ?>
                                </td>
                                <td><?= $value->quantity ?></td>
                                <td class="weight_eidt" id="<?=$value->id?>">
                                            
                                    <span style="padding:5px 0px;text-align: center;display: inline-block;min-width: 60px"><?=$value->weight?></span>
                                    <input type="text" name="input_weight_eidt[]" value="<?=$value->weight?>" style="display: none;width: 60px;text-align: center;" />
                                </td>

                                <td><a href='<?= base_url() . ADMIN_FOLDER ?>/users/view/<?= $value->user_id ?>'><?= $value->username ?></a></td>
                                <td><?= timespan($value->create_date, time()) ?></td>
                                <td><?= timespan($value->update_date, time()) ?></td>
                                <td><a href='<?= base_url() . ADMIN_FOLDER ?>/users/view/<?= $value->user_update ?>'><? $user_update=get_userdata_with_id($value->user_update,'username'); echo  $user_update['username'];   ?></a></td>
                                <td class="center">
                                    <div class="btn-group">
                                        <button class="button  dropdown-toggle" data-toggle="dropdown"><i class="icon-cog"></i>  <?=lang('label_operation')?> <span class="caret"></span></button>
                                        <ul class="dropdown-menu">
                                            <? if( $value->type == 'item_paid'){ ?>
                                            <li><a    href="<?= base_url() . ADMIN_FOLDER ?>/orders/edit/<?= $value->id ?>"><i class="icon-edit" ></i>  <?=lang('label_edit')?></a></li>
                                            <? }elseif($value->type == 'item_box'){ ?>
                                             <li><a    href="<?= base_url() . ADMIN_FOLDER ?>/orders/edit_box/<?= $value->id ?>"><i class="icon-edit" ></i>  <?=lang('label_edit')?></a></li>
                                            <? } ?>
                                            <li><a  class="delete_confirm " href="<?= base_url() . ADMIN_FOLDER ?>/orders/delete/<?= $value->id ?>"><i  class="icon-trash"></i> <?=lang('label_delete')?></a></li>
                                        </ul>
                                    </div>

                                </td>
                            </tr>
                        <? } ?>
                    </tbody>
                </table>




            </div>


            <div class="footer_tool_box">

                <select class="droop_tool_box" name='doaction'>
                    <option value=""><?=lang('label_choose_fromlist')?></option>
                    <option value="merge"><?=lang('label_merge')?></option>
                    <option value="delete"><?=lang('label_delete')?></option>
                </select>
                <?= form_dropdown('status', get_statues_list(), '', 'class="droop_tool_box_statues"') ?>
                <button class="button blue" id='execution' type="submit"><?=lang('label_execution')?></button>


            </div>


        </div>
    </div>

</div>

<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="tab-header">
                <i class="icon-cog"></i><?=lang('label_admin_action')?> </div>

            <div class="padded" id="action_load_mudle">
                <!-- action contant  -->

            </div>
        </div>
    </div>
</div>
</form>
<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>


